<ion-view cache-view="false">
    <ion-nav-title>银证转账</ion-nav-title>
    <ion-nav-buttons side="left">
        <back-button></back-button>
    </ion-nav-buttons>
    <ion-header-bar class="bar-subheader" style="padding:0">
        <div class="kTab clearfix">
            <a ng-class="{current: vm.activeTab == 1}" ng-click="vm.activeTab=1;" >银行转证券</a>
            <a ng-class="{current: vm.activeTab == 2}" ng-click="vm.activeTab=2;" >证券转银行</a>
            <a ng-class="{current: vm.activeTab == 3}" ng-click="vm.activeTab=3;" >资金明细</a>
        </div>
    </ion-header-bar>
    <ion-content ng-class="{'has-loading': isOffline}">
        <div ng-show="vm.activeTab==1" ng-controller="account_RechargeCtrl">
            <div class="kRemind" style="margin: 16px 15px 6px;">办理时间：每周一至周五09:00-16:00</div>
            <div class="kCells">
                <a class="kCell" href="#/query-balance" digital-keyboard=false>
                    <img class="icon" ng-src="{{bank.small_icon}}" />
                    <div class="kCellPrimary">
                        <p ng-if="'1' == bank.bkaccount_regflag">{{bank.bank_name}}</p>
                        <p ng-if="'1' != bank.bkaccount_regflag">{{bank.bank_name}}      尾号（{{bank.bank_account_show}}）</p>
                    </div>
                    <div class="kCellExtra" >余额查询</div>
                </a>
                <div class="kCell">
                    <div class="kCellTitle">充值金额</div>
                    <div class="kCellPrimary">
                        <input type="number" class="tel" ng-model="recharge.occur_balance" digital-keyboard=false
                               step="0.01" ng-blur="fixBalance()" maxlength="10" min="0" placeholder="请输入充值金额" />
                    </div>
                </div>
                <div class="kCell">
                    <div class="kCellTitle">银行卡密码</div>
                    <div class="kCellPrimary">
                        <input type="password"  maxlength="6" ng-model="recharge.bank_password" placeholder="请输入银行卡密码"
                               digital-keyboard="recharge.bank_password"/>
                    </div>
                </div>
            </div>
            <a id="recharge" class="kBtnDefault" ng-click="rechargeClick()">确定</a>
        </div>

        <div ng-show="vm.activeTab==2" ng-controller="account_WithdrawCtrl">
            <div class="kRemind" style="margin: 16px 15px 6px;">办理时间：每周一至周五09:00-16:00</div>
            <div class="kCell">
                <img class="icon" ng-src="{{bank.small_icon}}" />
                <div class="kCellPrimary">
                    <p ng-if="'1' == bank.bkaccount_regflag">{{bank.bank_name}}</p>
                    <p ng-if="'1' != bank.bkaccount_regflag">{{bank.bank_name}}      尾号（{{bank.bank_account_show}}）</p>
                </div>
            </div>
            <div class="kCell">
                <div class="kCellPrimary"><p>可提现金额(元)</p></div>
                <div class="kCellExtra lit"><em>{{amount | defNumber}}</em></div>
            </div>
            <div class="kCell">
                <div class="kCellTitle">提现金额</div>
                <div class="kCellPrimary">
                    <input type="number" class="tel" value="" name="occur_balance" ng-model="withdraw.occur_balance"
                           digital-keyboard=false
                           maxlength="10" step="0.01" ng-blur="fixBalance()"  placeholder="请输入提现金额" />
                </div>
            </div>
            <div class="kCell">
                <div class="kCellTitle">资金密码</div>
                <div class="kCellPrimary">
                    <input type="password" value="" maxlength="6" name="fund_password"
                           digital-keyboard="withdraw.fund_password"
                           ng-model="withdraw.fund_password" id="fund_password" placeholder="请输入资金密码" />
                </div>
            </div>
            <a ng-click="withdrawClick()" digital-keyboard=false class="kBtnDefault" >确定</a>
        </div>


        <div class="datatables" ng-show="vm.activeTab==3" ng-controller="account_TransferDetailsCtrl">
            <div class="datatables-hd">
                <table>
                    <tr>
                        <td style="width:40%">日期</td>
                        <td style="width:25%">类型</td>
                        <td style="width:35%" class="tar">金额(元)</td>
                    </tr>
                </table>
            </div>
            <div class="datatables-bd">
                <table>
                    <thead>
                    <tr>
                        <th style="width:40%"></th>
                        <th style="width:25%"></th>
                        <th style="width:35%"></th>
                    </tr>
                    </thead>
                    <tbody>
                    <tr colspan="3" ng-if="items.length == 0"><td>还没有流水</td></tr>
                    <tr ng-if="items.length > 0" ng-repeat="item in items">
                        <td>{{item.transfer_time | defDateString}}</td>
                        <td>{{item.trans_name}}</td>
                        <td class="tar">{{item.occur_balance | number : 2}}</td>
                    </tr>
                    </tbody>
                </table>
            </div>
        </div>

    </ion-content>
</ion-view>